﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Product-List.aspx.cs" Inherits="Product_List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <link href="css/DT_bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="css/select2_metro.css" rel="stylesheet" type="text/css" />
    <%--css for delete confirmation box--%>
    <link href="css/Popup.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div class="portlet box yellow">
        <div class="portlet-title">
            <div class="caption">
                <i class="icon-globe"></i>Product List</div>
        </div>
        <div class="portlet-body">
            <table class="table table-striped table-bordered table-hover table-full-width" id="sample_2">
                <thead>
                    <tr>
                        <th>
                            Name
                        </th>
                        <th>
                          Code
                        </th>
                        <th>
                         Network
                        </th>
                         <th>
                        Input Method
                        </th>
                           <th>
                        Image
                        </th>
                        <th class="hidden-480">
                            Action
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <asp:Repeater ID="rptProduct" runat="server" OnItemCommand="ItemCommand" OnItemDataBound="OnDataBound">
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <%# Eval("Name")%>
                                </td>
                                <td>
                                    <%# Eval("Code")%>
                                </td>
                                <td>
                                    <%# Eval("Network.Name")%>
                                </td>
                                     <td>
                                    <%# Eval("InputMethod.Name")%>
                                </td>
                                 <td>
                                   <asp:Image runat="server" ID="productImg" Height="50px" Width="80px" >
                                   </asp:Image>
                                </td>
                                <td>
                                    <center>
                                        <a href='Add-Product.aspx?Id=<%# Eval("Id") %>' title="Edit" class="with-tip">
                                            <img src="img/pencil.png" width="16" height="16" alt="Edit"></a>
                                            <asp:HiddenField runat="server" ID="hdfId" Value='<%# Eval("Id") %>' />
                                        <asp:HiddenField runat="server" ID="hdf" Value='<%# Eval("name") %>' />
                                        
                                        <asp:LinkButton runat="server" ID="lnkDelete" CommandName="Delete" OnClientClick="callAlert(this);return false;"
                                            CommandArgument='<%# Eval("Id") %>' Text="delete">
                                              <img src="img/cross-circle.png" width="16" height="16" alt="Delete">
                                        </asp:LinkButton>
                                    </center>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>
            </table>
        </div>
    </div>
    <script type="text/javascript" src="js/select2.min.js"></script>
    <script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="js/DT_bootstrap.js"></script>
    <script src="js/table-advanced.js" type="text/javascript"></script>
    <script>
        jQuery(document).ready(function () {
            TableAdvanced.init();
        });
    </script>
    <%--confirmation popup--%>
    <script src="js/PopupManager.js" type="text/javascript"></script>
    <script>
        function callAlert(element) {


            var $btn = $(element) // Gets clicked button
            var hiddenBValue = $btn.prev().val(); // Gets hidden element value

            AlertCust(element, 'Confirmation', 'are you sure want to remove ' + hiddenBValue + ' ?', IconType.information, PromptType.OkCancel, null, null);
        }
    </script>
    </asp:Content>